//
//  GlobalFuns.swift
//  KCB
//
//  Created by leeqb on 11/1/15.
//  Copyright © 2015 powerlee. All rights reserved.
//

// 自定义RGB颜色值
func RGB(r: CGFloat, g: CGFloat, b: CGFloat) -> UIColor {
    return UIColor(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: 1)
}

// 加载Storyboard中的VC
func LB(sName: String, vcName: String) -> AnyObject? {
    let sb = UIStoryboard(name: sName, bundle: NSBundle.mainBundle())
    let vc = sb.instantiateViewControllerWithIdentifier(vcName)
    return vc
}

// 加载Storyboard的初始化界面
func LBI(sName: String) -> AnyObject? {
    let sb = UIStoryboard(name: sName, bundle: nil)
    let vc = sb.instantiateInitialViewController()
    return vc
}

func LX(xName: String, owner: AnyObject) {
    NSBundle.mainBundle().loadNibNamed(xName, owner: owner, options: nil)
}
